import request from '@/utils/myRequest'

// 获取地址列表
function addressList() {
  return request({
    url: `/lejuAdmin/companyAddress/addressList`
  })
}
// 新增地址
function saveAddress(data) {
  return request({
    url: `/lejuAdmin/companyAddress/save`,
    method: 'POST',
    data
  })
}
// 地址明细
function addressDetail(id) {
  return request({
    url: `/lejuAdmin/companyAddress/{id}`
  })
}
// 删除地址
function deleteAddress(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`,
    method: 'DELETE'
  })
}
// 更新地址
function update(data) {
  return request({
    url: `/lejuAdmin/companyAddress/update`,
    method: 'POST',
    data
  })
}
// 设为收货地址
function setReceiveOne(data) {
  return request({
    url: `/lejuAdmin/companyAddress/setReceiveOne`,
    method: 'POST',
    data
  })
}
// 设为发货地址
function setSendOne(data) {
  return request({
    url: `/lejuAdmin/companyAddress/setSendOne`,
    method: 'POST',
    data
  })
}

export { addressList, saveAddress, addressDetail, deleteAddress, update, setReceiveOne, setSendOne }
